﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TransSettings : MonoBehaviour
{
    public bool isBattle = false;
    public bool isCheck = false;

    public Vector3 currentAxis;
    
    void Start()
    {
        currentAxis = isBattle == true ? new Vector3(0, 1, 0) : new Vector3(0, 0, -1);
        
        ChangeTransparency(currentAxis);
    }

    private void Update()
    {
        if (isCheck)
        {
            ChangeTransparency(currentAxis);
            
            isCheck = false;
        }
    }

    private void ChangeTransparency(Vector3 sortAxis)
    {
        if (Camera.main != null) Camera.main.transparencySortAxis = sortAxis;
    }
}
